StoredLearningSession.CreateAttempt Method (PackageStore, UserItemIdentifier, ActivityPackageItemIdentifier)

Create an attempt on a specific package. The package must have already been added to LearningStore. Following this method, Start must be called in order to deliver the first activity. This method does not provide logging information for the session.

Parent Type: StoredLearningSession

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public static StoredLearningSession CreateAttempt (
PackageStore packageStore,
UserItemIdentifier learnerId,
ActivityPackageItemIdentifier rootActivityId

)

Parameters

packageStore

The store which contains files from the package associated with the attempt.

learnerId

The learner who is starting the attempt.

rootActivityId

The LearningStore id of the organization (ie, root activity) to be attempted.

Return Value

Returns a session representing the new attempt. The AttemptStatus of the session will be Active.

Exceptions
Exception type Condition
ArgumentNullException

Thrown when packageStore is null.

InvalidOperationException

Thrown if the learnerId or rootActivityId do not represent valid objects.

Remarks

This method adds attempt information to LearningStore.

After creating the attempt, the caller must call Start to identify the first activity for delivery.